<?php print HTML::style('css/table.css');?>

<?php
if(Session::has('meessage'))
  print '<p style="color: green;">' . Session::get('message') . '</p>';
?>

<div class="CSSTableGenerator" style="width:800px;">
<table>
<tr>
  <th>ID</th>
  <th>Category Id</th>
  <th>Name</th>
  <th>Title</th>
  <th>ImageId</th>
  <th>Views</th>
  <th>Rating</th>
  <th>Rating_count</th>
  <th>Status</th>
  <th>Width</th>
  <th>Height</th>
</tr>
<?php
  $games = Game::LoadGames();
  
  foreach($games as $game)
  {
    print '<tr>'
        . '<td>' . $game->id . '</td>'
        . '<td>' . $game->categoryId . '</td>'
        . '<td>' . $game->name . '</td>'
        . '<td>' . $game->title . '</td>'
        . '<td>' . $game->imageId . '</td>'
        . '<td>' . $game->views . '</td>'
        . '<td>' . $game->rating . '</td>'
        . '<td>' . $game->ratingCount . '</td>'
        . '<td>' . $game->status . '</td>'
        . '<td>' . $game->width . '</td>'
        . '<td>' . $game->height . '</td>'
        . '</tr>';
  }

?>
</table>
</div>

<p><?php print HTML::link_to_route('new', 'New Game')?></p>